<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
  <script>
     class Vue{
       constructor (data) {
         for(let item in data) {
          Object.defineProperty(this, item, {
            get (val) {
              return data[item]
            },
            set (val) {
              console.log('set', val)
            },
            // value: data[item]
          })
         }
       }
     }
  </script>
  <script>
    let vue = new Vue({
      test: 'testVal',
      test2: 'test2Val'
    })
    console.log(vue);
    console.log(vue.test);
    
  </script>
</body>
</html>
